package com.ruoyi.common.config;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * 获取短信参数
 *
 * @author ZouYangMing
 */
@Component
@ConfigurationProperties(prefix = "sms")
public class SmsConfig implements InitializingBean {

    /**
     * 短信宝用户名
     */
    private String username;
    /**
     * 短信宝密码
     */
    private String password;
    /**
     * 短信宝签名
     */
    private String content;

    // 方便直接获取
    public static String SMS_USERNAME;
    public static String SMS_PASSWORD;
    public static String SMS_CONTENT;

    @Override
    public void afterPropertiesSet(){
        SMS_USERNAME = username;
        SMS_PASSWORD = password;
        SMS_CONTENT = content;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }
}
